package com.strange.mdl.module.mdl.controller.app.activity.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

import static com.strange.mdl.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 活动用户参与记录新增/修改 Request VO")
@Data
public class AppActivityUserSaveReqVO {

    @Schema(description = "活动ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16170")
    private Long activityId;

    @Schema(description = "用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32560")
    private Long userId;

    @Schema(description = "参与状态：0-报名中；1-已取消；2-已签到；3-待审核；4-已拒绝", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @NotNull(message = "参与状态：0-报名中；1-已取消；2-已签到；3-待审核；4-已拒绝不能为空")
    private Integer status;

    @Schema(description = "报名时间")
    @JsonDeserialize(using = LocalDateDeserializer.class) // 反序列化（请求）
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime signupTime;

    @Schema(description = "取消时间")
    @JsonDeserialize(using = LocalDateDeserializer.class) // 反序列化（请求）
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime cancelTime;

    @Schema(description = "是否签到：0-否；1-是", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer checkedIn;

    @Schema(description = "角色：0-普通参与者；1-组织者；2-管理员", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer role;

}